netsuite-js

CustomerSearchAdvanced

declaration
CustomerSearchAdvanced ->CustomerSearchAdvanced

var CustomerSearchAdvanced = module.exports = function CustomerSearchAdvanced() {
  SearchRecord.call(this);

  // Strangely, inherits from SearchRecord but does NOT have a `searchFields` field.
  // Instead has a `criteria` CustomerSearch field
  delete this.searchFields;

criteria

property
this.criteria

@member {CustomerSearch} Search criteria

this.criteria = undefined;

columns

property
this.columns

@member {CustomerSearchRow} Columns to return

this.columns = undefined;

savedSearchId

property
this.savedSearchId

@member {String|Number}

this.savedSearchId = null;

savedSearchScriptId

property
this.savedSearchScriptId

@member {String|Number}

this.savedSearchScriptId = null;
};

util.inherits(CustomerSearchAdvanced, SearchRecord);

getAttributes

method
CustomerSearchAdvanced.prototype.getAttributes()

@override

CustomerSearchAdvanced.prototype.getAttributes = function() {
  var attrs = {
    'xsi:type': 'listRel:CustomerSearchAdvanced'
  };

  if (this.savedSearchId) {
    attrs.savedSearchId = this.savedSearchId;
  }

  if (this.savedSearchScriptId) {
    attrs.savedSearchScriptId = this.savedSearchScriptId;
  }

  return attrs;
};

getUnserializablePropertyNames

method
CustomerSearchAdvanced.prototype.getUnserializablePropertyNames()

@override

CustomerSearchAdvanced.prototype.getUnserializablePropertyNames = function() {
  return ['savedSearchId', 'savedSearchScriptId'];
};

getXml

method
CustomerSearchAdvanced.prototype.getXml()

@override

CustomerSearchAdvanced.prototype.getXml = function() {
  // Need to override in a different way than parent `SearchRecord`
  var xml = [];

  if (this.criteria) {
    // TODO: serialize criteria
  }

  if (this.columns) {
    xml.push('<listRel:columns>');
    xml.push(this.columns.getXml());
    xml.push('</listRel:columns>');
  }

  return xml.join('');
};